<!-- 性别选择组件 -->
<template>
    <view>
        <!-- 选择器 -->
        <u-picker keyName="label" :show="sexShows" @cancel="sexConfirm" :columns="sexColumns"
            @confirm="sexConfirm"></u-picker>
    </view>
</template>
  
<script>
export default {
    props: {
        show: {
            type: Boolean,
            default: false
        },
    },
    data() {
        return {
            sexShows: false,
            sexColumns: [[{ value: 0, label: "女" }, { value: 1, label: "男" }]],
        };
    },
    watch: {
        // 是否打开picker
        show: {
            handler(newValue, oldValue) {
                this.sexShows = newValue
            },
            immediate: true,
        },
    },
    computed: {},
    created() {
    },
    onReady() { },
    methods: {
        // 返回当前选中的label 
        sexConfirm(e) {
            this.$emit("sexConfirm", e ? e.value[0] : undefined)
        },
    },
};
</script>
  
<style lang="scss" scoped>
.wrapper {
    // height: 100%;
    background-color: #fff;

    .content {
        flex: 1;
        overflow-y: scroll;
    }

    .btns {}
}
</style>